package com.auto.sns.core.dao.impl;

import java.util.List;
import java.util.Map;

import com.system.common.Page;
import com.auto.sns.core.domain.SnsCoreTopic;
import com.auto.sns.core.dao.ISnsCoreTopicDAO;
import com.system.util.PersistUtil;
import com.auto.sns.core.sql.sqlid.SnsCoreActivitySqlID;
import com.auto.sns.core.sql.sqlid.SnsCoreTopicSqlID;
/**
 * : t_auto_sns_core_topic
 * 
 * 
 * @author Gen
 */
public class SnsCoreTopicDAOImpl implements ISnsCoreTopicDAO{

	public SnsCoreTopic insertSnsCoreTopic(SnsCoreTopic bean){
		return PersistUtil.insert(bean, SnsCoreTopicSqlID.INSERT);
	}

	public boolean deleteSnsCoreTopic(String sctoGuid){
		PersistUtil.delete(sctoGuid, SnsCoreTopicSqlID.DELETE);
		return true;
	}	

	public SnsCoreTopic updateSnsCoreTopic(SnsCoreTopic bean){
		return PersistUtil.update(bean, SnsCoreTopicSqlID.UPDATE);
	}	

	public SnsCoreTopic loadSnsCoreTopic(String sctoGuid){
		return PersistUtil.query(new SnsCoreTopic().getClass(), sctoGuid);
	}

	public List<SnsCoreTopic> queryList(Map<String,Object> param,Page page){
		page.setCount(PersistUtil.countSpecial(param, SnsCoreTopicSqlID.QUERY));
		return PersistUtil.querySpecial(param, SnsCoreTopicSqlID.QUERY, page.getFullOrderBy(), page.getOffset(), page.getLimit());
	}

	public boolean updateReplyNum(String sctoGuid) {
		PersistUtil.update(sctoGuid, SnsCoreActivitySqlID.UPDATE_REPLY_NUM);
		return true;
	}

	public boolean updateRecommendNum(String sctoGuid) {
		PersistUtil.update(sctoGuid, SnsCoreActivitySqlID.UPDATE_RECOMMEND_NUM);
		return true;
	}

	public boolean updateFavoriteNum(String sctoGuid) {
		PersistUtil.update(sctoGuid, SnsCoreActivitySqlID.UPDATE_FAVORITE_NUM);
		return true;
	}

}
